1 <?php
2 session_start();
3 if(isset($_SESSION['user']))
4 {
5
6 }
7 else{
8 echo"<script>location.href='login.html'</script>";
9 }
10 ?>
11 <html>
12 <head>
13 <title>Birds </title>
14 <style>
15 body {
16 margin: 0;
17 font-family: Arial, Helvetica, sans-serif;
18 background: #484848;
19 }
20 .topnav {
21 overflow: hidden;
22 background-color:rgba(44, 130, 201, 1);
23 height: 70px;
24 border: 3px solid #3333ff
25 }
26
27 .topnav a {
28 float: left;
29 color: #f2f2f2;
30 text-align: center;
31 padding: 14px 16px;
32 text-decoration: none;
33 font-size: 35px;
34 font-weight: bold;
35 }
36
37 .topnav-right {
38 float: right;
39 }
40 table {
41 font-family: arial, sans-serif;
42 border-collapse: collapse;
43 outline:#4d4dff solid 5px;
44 background: #FAFAFA;
45 width: 100%;
46 margin:5px ;
47
48 }
49
50 td, th {
51 border: 1px solid #dddddd;
52 text-align: left;
53 padding: 8px;
54 }
55 th{
56 background-color:rgba(44, 130, 201, 1);
57 }
58
59
60 .custombutton{
61 margin:25px;
62
63 }
64 input[type=text] {
65 width: 15%;
66 padding: 12px 20px;
67 margin:8px ;
68 border: 2px solid red;
69 background:transparent;
70 }
71
72 </style>
73 </head>
74 <body>
75 <div class="topnav">
76 <a class="active" href="home.html"><img src="ic_add_pet.png"></a>
77 <a href="birds.php">Birds</a>
78 <div class="topnav-right">
79 <a href="logout.php">logout</a>
80 </div>
81 </div>
82
83 <div class="custombutton">
84 <form>
85 <button style="height: 50px;width: 150px;cursor:pointer;border-radius:15px;
86 border: 3px solid #3333ff;background-color:rgba(44, 130, 201, 1);color:#f2f2f2;font-size:17px;" formaction="birdsadd.php">Add new bird</button>
87 <button style="margin-left:900px; height: 50px;width: 150px;cursor:pointer;border-radius:15px;
88 border: 3px solid #3333ff;background-color:rgba(44, 130, 201, 1);color:#f2f2f2;font-size:17px;" formaction="birdsupdate.php">update bird</button>
89 </form>
90 </div>
91 <?php
92
93 $con = mysqli_connect("localhost","root","","Petshop_management");
94 if(!$con)
95 {
96 die("could not connect".mysql_error());
97 }
98 $var=mysqli_query($con,"select P.pet_id,P.pet_category,A.type,A.noise, P.cost from pets P,birds A where P.pet_id=A.pet_id ");
99 echo "<table border size=10>";
100 echo "<tr>
101 <th>pet_ID</th>
102 <th>petcategory</th>
103 <th>type</th>
104 <th>noise</th>
105 <th>cost</th>
106 </tr>";
107 if(mysqli_num_rows($var)>0){
108 while($arr=mysqli_fetch_row($var))
109 { echo "<tr>
110 <td>$arr[0]</td>
111 <td>$arr[1]</td>
112 <td>$arr[2]</td>
113 <td>$arr[3]</td>
114 <td>$arr[4]</td>
115 </tr>";}
116 echo "</table>";
117 mysqli_free_result($var);
118 }
119
120 mysqli_close($con);
121
122
123 ?>
124 <div class="lastblock" style="margin-top:25px;">
125 <form action="deletebird.php" method="post">
126
127 <input type="text" name="t1" placeholder="Enter the id to delete" required>
128 <input style="width:75px;height:44px;cursor:pointer;border-radius:15px;
129 border: 3px solid #3333ff;background-color:rgba(44, 130, 201, 1);color:#f2f2f2;font-size:17px;" type="submit" value="delete">
130 </form>
131 </div>
132 </body>
133 </html>